package com.myiam.idm.core.services.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.myiam.idm.core.model.Role;
import com.myiam.idm.core.services.RoleManagementService;
import com.myiam.idm.core.services.impl.helper.ModelToMetaModel;
import com.myiam.idm.core.syncservices.IdentitySyncServiceDelegate;
import com.myiam.idm.meta.dao.IdentityRepositoryImpl;
import com.myiam.idm.meta.dao.RoleManagementRepositoryImpl;
import com.myiam.idm.meta.model.MmRole;

@Repository
@Transactional
public class RoleManagementServiceImpl implements RoleManagementService {
	
	//@Autowired
	private RoleManagementRepositoryImpl roleMgtRepo;
	
	//todo add sync

	@Override
	public long create(Role role) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void store(Role role) {
		
		MmRole metaRole = ModelToMetaModel.roleToM2MM(role);
		
		
		roleMgtRepo.save(metaRole);
		
		
	}

	@Override
	public Role getById(long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Role findByName(String name) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void addRoleExclusion(Role role, Role role2) {
		// TODO Auto-generated method stub
		
	}
	
	

}
